package cn.mong.util.modelexcel;

import org.apache.poi.xssf.usermodel.XSSFCellStyle;


/**
 * 单元格样式定制器
 * @author mengxianming@2021-9-10 9:56:34
 *
 */
@FunctionalInterface
public interface CellStyleCustomizer{
    /**
     * 定制单元格样式。
     * @param cellStyle 
     * @return 返回定制后的样式。可以与输入一致。
     */
    XSSFCellStyle doCustomize(XSSFCellStyle cellStyle);
    
    public static CellStyleCustomizer getDefault() {
        return DefaultCellStyleCustomizer.getInstance();
    }
    
    public static class DefaultCellStyleCustomizer implements CellStyleCustomizer{
        private static final DefaultCellStyleCustomizer instance = new DefaultCellStyleCustomizer();

        @Override
        public XSSFCellStyle doCustomize(XSSFCellStyle cellStyle) {
            return cellStyle;
        }
        
        public static DefaultCellStyleCustomizer getInstance() {
            return instance;
        }
        
    }
}